#pragma once

#include <JuceHeader.h>

class StyledComponent : public juce::Component {
public:
    struct View {
        juce::Colour backgroundColor;
        juce::Colour borderColor = juce::Colours::black;
        int borderRadius = 0;
        int borderWidth = 0;
        int height;
        int width;
        int left;
        int top;

        int getBottom() { return top + height; }

        int getRight() { return left + width; }
    };

    StyledComponent();
    StyledComponent(View stylesToUse);
    ~StyledComponent() override;

    void addChild(std::shared_ptr<Component> child);
    void paint(juce::Graphics&) override;
    void resized() override;

    View styles;

private:
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(StyledComponent)
    std::vector<std::shared_ptr<Component>> children;
};
